package com.applink.sell_proof.fragment.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;

import com.applink.sell_proof.fragment.AllProjectFragment;
import com.applink.sell_proof.fragment.ApprovalProjectFragment;
import com.applink.sell_proof.fragment.DraftProjectFragment;
import com.applink.sell_proof.fragment.PendingProjectFragment;

/**
 * @author Hoang Viet
 * 
 */
public class SellFragmentPagerAdapter extends BaseFragmentPagerAdapter {
	private static final String[] TITLES = new String[] { "ALL", "APPROVED",
			"SUBMITTED", "DRAFT" };
	public static final int INDEX_ALL = 0;
	public static final int INDEX_APPROVAL = 1;
	public static final int INDEX_PENDING = 2;
	public static final int INDEX_DRAFT = 3;

	public SellFragmentPagerAdapter(FragmentManager fm) {
		super(fm, TITLES);
	}

	@Override
	public Fragment getItem(int index) {
		switch (index) {
		case INDEX_ALL:
			AllProjectFragment all = new AllProjectFragment();
			mFragments.put(index, all);
			return all;
		case INDEX_APPROVAL:
			ApprovalProjectFragment approval = new ApprovalProjectFragment();
			mFragments.put(index, approval);
			return approval;
		case INDEX_PENDING:
			PendingProjectFragment pending = new PendingProjectFragment();
			mFragments.put(index, pending);
			return pending;
		case INDEX_DRAFT:
			DraftProjectFragment draft = new DraftProjectFragment();
			mFragments.put(index, draft);
			return draft;
		default:
			return null;
		}
	}
}
